/********************************************
* TABLE A16: Staff Compensation - using Rank 3 
********************************************/
* Panel A: House
clear
use masterdata_house3.dta
sort core_person_id
merge core_person_id using firstcong.dta
keep if _merge == 3
drop _merge
la var firstcong "congress staffer appeared first time in the data"
keep if firstcong >=108
gen exp = 2*(congress - firstcong +1) 
gen femalestaff = 0
replace femalestaff = 1 if gender =="F"
gen memfemale = 0
replace memfemale = 1 if minwomen + majwomen > 0

macro define member_char1 "dem memfemale majority chair subchr seniority maj_leader min_leader power"
macro define member_char2 "majority chair subchr seniority maj_leader min_leader power"
macro define staff_char1  "exp totworkdays rank nondc notfulltime"
macro define staff_char2  "exp totworkdays rank nondc notfulltime jdphd grad_degree "

gen int1 = dem*femalestaff
gen int2 = dem*femalestaff*memfemale

eststo clear
eststo: quietly reg  salary femalestaff           $member_char1 $staff_char1 i.congress, vce(cluster member_office_id)
eststo: quietly reg  salary femalestaff int1      $member_char1 $staff_char1 i.congress, vce(cluster member_office_id)
eststo: quietly reg  salary femalestaff int1 int2 $member_char1 $staff_char1 i.congress, vce(cluster member_office_id)
eststo: quietly areg salary femalestaff int1 int2 $member_char2 $staff_char1 i.congress, a(member_office_id) vce(cluster member_office_id)
eststo: quietly areg salary femalestaff int1 int2 $member_char2 $staff_char2 i.congress, a(member_office_id) vce(cluster member_office_id)
esttab, star(* 0.05 ** 0.01 *** 0.001) drop(*congress*) se ar2

* Panel B: Senate
clear
use masterdata_senate3.dta
sort core_person_id
merge core_person_id using firstcong.dta
keep if _merge == 3
drop _merge
gen exp = 2*(congress - firstcong +1) 
la var firstcong "congress staffer appeared first time in the data"

gen memfemale = 0
replace memfemale = 1 if minwomen ==1
replace memfemale = 1 if majwomen ==1

gen femalestaff = 0
replace femalestaff = 1 if gender =="F"

gen int1 = dem*femalestaff
gen int2 = dem*femalestaff*memfemale

macro define member_char1 "dem memfemale majority chair subchr seniority maj_leader min_leader power up_for_reelection freshman"
macro define member_char2 "majority chair subchr seniority maj_leader min_leader power up_for_reelection freshman"
macro define staff_char1  "exp totworkdays rank nondc notfulltime"
macro define staff_char2  "exp totworkdays rank nondc notfulltime jdphd grad_degree"

eststo clear
eststo: quietly reg  salary femalestaff           $member_char1 $staff_char1 i.congress, vce(cluster member_office_id)
eststo: quietly reg  salary femalestaff int1      $member_char1 $staff_char1 i.congress, vce(cluster member_office_id)
eststo: quietly reg  salary femalestaff int1 int2 $member_char1 $staff_char1 i.congress, vce(cluster member_office_id)
eststo: quietly areg salary femalestaff int1 int2 $member_char2 $staff_char1 i.congress, a(member_office_id) vce(cluster member_office_id)
eststo: quietly areg salary femalestaff int1 int2 $member_char2 $staff_char2 i.congress, a(member_office_id) vce(cluster member_office_id)
esttab, star(* 0.05 ** 0.01 *** 0.001) drop(*congress*) se ar2

